package com.billionsfinance.hessian.controller;

import com.billionsfinance.hessian.core.RemoteCall;
import com.billionsfinance.hessian.server.DemoServer;
import com.billionsfinance.hessian.server.HelloServer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class HelloController {

	@RequestMapping("/hello")
	public String hello() {
		HelloServer helloServer = RemoteCall.getRemoteObject(HelloServer.class);
		return helloServer.sayHello("zhang");
	}

	@RequestMapping("/demo")
	public int demo() {
		DemoServer demoServer = RemoteCall.getRemoteObject(DemoServer.class);
		return demoServer.add(5, 10);
	}
}
